import { Button, Card, Form } from 'antd';
import { useModel } from "@umijs/max";
import UpdatePassword from "./component/UpdatePassword";

export default function (){
  const {data} = useModel('user')

  return <Card>
    <Form labelCol={{style: {width: 80}}} labelAlign="left">
      <Form.Item label="账号名">
        {data.username}
      </Form.Item>
      <Form.Item label="姓名">
        {data.name}
      </Form.Item>
      <Form.Item label="职位">
        {data.job}
      </Form.Item>
      <Form.Item label="手机号">
        {data.mobile}
      </Form.Item>
      <Form.Item label="登录密码">
        <UpdatePassword>
          <Button type="primary">修改密码</Button>
        </UpdatePassword>
      </Form.Item>
      <Form.Item label="关联角色">
        {data.roleNames.join('、')}
      </Form.Item>
    </Form>
  </Card>
}
